<%@ include file="/WEB-INF/views/jsp/include/include.jsp"%>
<html>
<head>
    <title>Hand In Hand</title>
    <%@ include file="/WEB-INF/views/jsp/include/head.jsp"%>
</head>
<script type="text/javascript">

$( document ).ready(function() {
	$("#userRegisterForm").submit( function(event) {
		$('#selectedTags').val($("input[name='hiddenTagList']").val());
	});
});
$(function () {
    $(".tagsManager").tagsManager({
         prefilled: $('#selectedTags').val(),
         CapitalizeFirstLetter: true,
         preventSubmitOnEnter: true,
         typeahead: true,
         typeaheadAjaxSource: null,
         typeaheadSource: null,
         delimeters: [44, 188, 13],
         backspace: [8],
         blinkBGColor_1: '#FFFF9C',
         blinkBGColor_2: '#CDE69C',
         hiddenTagListId: 'hiddenTagList',
         hiddenTagListName: 'hiddenTagList',
         replace: true,
         tagsContainer: $('.tagList'),
         maxTags: 15
     });
});
</script>
<body>
	<%@ include file="/WEB-INF/views/jsp/include/header_justlogo.jsp"%>

	<div class="container-fluid">
		<div id="registerForm">
			<form:form id="userRegisterForm" modelAttribute="userRegisterForm"  method="post" action="./saveUser">
			<div class="row">
				<div class="form-fields col-xs-5 col-xs-offset-2">
					<form:input path="user.name" type="text" class="form-control" cssErrorClass="form-control inputError" placeholder="Name" />
					<form:errors path="user.name" cssClass="errorMessage" />
					<form:input path="user.surname" type="text" class="form-control" cssErrorClass="form-control inputError" placeholder="Surname" />
					<form:errors path="user.surname" cssClass="errorMessage" />
					<form:input path="user.username" type="text" class="form-control" cssErrorClass="form-control inputError" placeholder="Username" />
					<form:errors path="user.username" cssClass="errorMessage" />
					<form:input path="user.email" type="text" class="form-control" cssErrorClass="form-control inputError" placeholder="Email" />
					<form:errors path="user.email" cssClass="errorMessage" />
					<form:input path="user.password" type="password" class="form-control" cssErrorClass="form-control inputError" placeholder="Password" />
					<form:errors path="user.password" cssClass="errorMessage" />
					<form:input path="rePassword" type="password" class="form-control" cssErrorClass="form-control inputError" placeholder="Confirm Password" />
					<form:errors path="rePassword" cssClass="errorMessage" />
				</div>
				<div class="col-xs-3">
					<div style="border: 1px solid #b78f41 !important; border-radius: 10px; height: 140px;" class="form-fields" id="Interest">
					<table style="margin:8px;">
						<tr>
							<td>
								<label>Interests</label>
								<input type="text" name="tags" placeholder="Tags" class="tagsManager tm-input-success tm-input-small"/>
								<div class="tagList">
								</div>
								<form:input hidden="true" id="selectedTags" path="selectedTags" />
							</td>
						</tr>
					</table>
					</div>
					<table>
				     	<tr>
						<td style="padding:14px;" align="center" colspan="2" class="checkbox">
							<label>
							<input type="checkbox" class="checkbox">
							Please read and accept terms and conditions
							</label><br>
							<button class="btn btn-lg btn-primary btn-block col-xs-2" type="submit" ><b>Register</b></button>
						</td>
						</tr>
							
					</table>
				</div>

			</div>
			</form:form>
			<hr>
			<div class="col-xs-2 col-xs-offset-5">
			<label>Already have an account?</label>
				<button class="btn btn-lg btn-primary btn-block" onclick="location.href='<spring:url value="/login"></spring:url>'">Sign In</button>
		</div>
		</div>	
	</div>

	<%@ include file="/WEB-INF/views/jsp/include/footer.jsp"%>


</body>
</html>